import React from 'react'
import ReactDOM from 'react-dom'

class Header extends React.Component {
  render() {
    return (
      // <React.Fragment>
      //   <h1>{ this.props.title }</h1>
      //   <h2>{ this.props.subtitle }</h2>
      //   { this.props.children }
      // </React.Fragment>
      <>
        <h1>{ this.props.title }</h1>
        <h2>{ this.props.subtitle }</h2>
        { this.props.children }
      </>
    )
  }
}

ReactDOM.render(
  <Header title="主标题" subtitle="副标题">
    <span>这是嵌套的子节点内容</span>
  </Header>,
  document.getElementById('root')
)